package br.com.robot;

import br.com.robot.implement.AbstractRobot;

public class RobotBean<T extends AbstractRobot>
{
	private int      id;
	private String   nome;
	private Class<T> tipo;
	
	public String getNome( )
	{
		return nome;
	}
	
	public void setNome( String nome )
	{
		this.nome = nome;
	}
	
	public Class<T> getTipo( )
	{
		return this.tipo;
	}
	
	public void setTipo( Class<T> tipo ) 
	{
		this.tipo = tipo;
	}

	public int getId( )
	{
		return id;
	}

	public void setId( int id )
	{
		this.id = id;
	}
	
	public RobotBean( int id, String nome, Class<T> tipo )
	{
		super( );
		this.id   = id;
		this.nome = nome;
		this.tipo = tipo;
	}

	@Override
	public int hashCode( )
	{
		final int prime  = 31;
		      int result = 1;
		      
		result = prime * result + id;
		
		return result;
	}

	@Override
	public boolean equals( Object obj )
	{
		if( this == obj )
			return true;
		
		if( obj == null )
		 	return false;
		
		if( getClass( ) != obj.getClass( ) )
			return false;
		
		@SuppressWarnings("unchecked")
		RobotBean<T> other = (RobotBean<T>)obj;
		
		if( id != other.id )
			return false;
		
		return true;
	}
}